import { $delete, $get, $post, $put } from './http'

// 获取所有商品分类
export const getGoodsCateListReq = params => $get('/categories', params)

// 删除分类
export const deleteGoodsCateReq = id => $delete(`/categories/${id}`)

// 添加或编辑分类
export const addOrEditGoodsCateReq = (id, params) =>
  id ? $put(`/categories/${id}`, params) : $post('/categories', params)
